<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Title</title>
    <style>
      body {
        margin: 0;
        padding: 40px;
        background: #fff;
        font: 80% Arial, Helvetica, sans-serif;
        color: #555;
        line-height: 180%;
      }
      p {
        clear: both;
        margin: 0;
        padding: 0.5em 0;
      }

      #tooltip {
        position: absolute;
        border: 1px solid red;
        background: #f7f5d1;
        padding: 1px;
        color: #333;
        display: none;
      }
    </style>
  </head>
  <body>
    <p><a href="#" class="tooltip" title="这是我的超链接提示1.">提示1.</a></p>
    <p><a href="#" class="tooltip" title="这是我的超链接提示2.">提示2.</a></p>
    <p><a href="#" title="这是自带提示1.">自带提示1.</a></p>
    <p><a href="#" title="这是自带提示2.">自带提示2.</a></p>

    <script src="../static/plugins/jquery/jquery-3.3.1.min.js"></script>
    <script>
      $(function () {
        $("a .tooltip").mouseover(function (e) {
          //鼠标移入，显示
          var tooltip = "<div id='tooltip'>" + this.title + "<\/div>";
          $("body").append(tooltip);
          $("#tooltip")
            .css({ top: e.pageY + "px", left: e.pageX + "px" })
            .show();
        });

        $("a .tooltip").onmouseout(function () {
          //鼠标移出，隐藏
          $("#tooltip").remove();
        });
      });


      
    </script>
  </body>
</html>
